//
//  OnionCertificationController.m
//  OnionHome
//
//  Created by fengjie on 2019/10/2.
//  Copyright © 2019 FengJie. All rights reserved.
//

#import "OnionCertificationController.h"
#import "IDCardCertificationController.h"
#import "ChooseInterestController.h"
#import "OnionCertificationCell.h"

@interface OnionCertificationController ()
/**listViewTool*/
@property (nonatomic,strong)UITableViewTool*listViewTool;
/**<#属性#>*/
@property (nonatomic,strong)NSMutableArray*dataArray;
@end

@implementation OnionCertificationController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"葱花认证";
    [self.listViewTool.listView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
}
-(UITableViewTool*)listViewTool{
    if(!_listViewTool){
        kWeakSelf(weakSelf);
        _listViewTool=[[UITableViewTool alloc] initWithFrame:CGRectZero style:UITableViewStylePlain registerCellClassName:NSStringFromClass([OnionCertificationCell class]) identifier:NSStringFromClass([OnionCertificationCell class]) dataArray:self.dataArray delegate:self dataSourceBlock:^(id  _Nonnull TempCell, NSIndexPath * _Nonnull indexPath, id  _Nonnull TempData) {
            OnionCertificationCell * cell = (OnionCertificationCell *)TempCell;
            cell.dic = (NSDictionary *)TempData;
            
        } selectCell:^(id  _Nonnull TempCell, NSIndexPath * _Nonnull indexPath, id  _Nonnull TempData) {
            if (indexPath.row == 0) {
                [weakSelf pushIdCard];
            }else{
                [weakSelf.navigationController pushViewController:[ChooseInterestController new] animated:YES];
            }
        }];
        _listViewTool.listView.backgroundColor = UIColorFromRGB(0xF5F7F5);
    }
    return _listViewTool;
}
-(void)pushIdCard{
    [self.navigationController pushViewController:[IDCardCertificationController new] animated:YES];
}
-(NSMutableArray *)dataArray{
    if (!_dataArray) {
        NSDictionary * oneDic = @{@"topName":@"身份认证",@"bomName":@"适用于个人用户真实身份的认证"};
        NSDictionary * twoDic = @{@"topName":@"兴趣认证",@"bomName":@"在美食领域持续贡献的内容用户"};

        _dataArray =[NSMutableArray array];
        [_dataArray addObject:oneDic];
        [_dataArray addObject:twoDic];
    }
    return _dataArray;
}
@end
